public class Circle {
    //成员变量
    public Point center;
    public int radius;
    //构造方法
    public Circle(){
        Point p=new Point();
        this.center=p;
        //this.radius=0;
        this.getCenter();
        this.getRadius();
    }
    public Circle(int x,int y,int r){
        Point p=new Point(x,y);
        this.center=p;
        this.setR(r);
    }
    public Circle(Point c,int r){
        this.setPo(c);
        this.setR(r);
    }
    //成员方法
    public void setCenter(Point center){
        this.center=center;
    }
    public Point getCenter(){
        return this.center;
    }
    public void setRadius(int radius){
        this.radius=radius;
    }
    public int getRadius(){
        return this.radius;
    }
    public void setR(int r){
        if(r>=0){
            this.radius=r;
        }
    }
    public int getR(){
        return this.radius;
    }
    public void setPo(Point p){
        this.center=p;
    }
    public Point getPo(){
        return this.center;
    }
    public double perimeter(){
        double per=2*Math.PI*this.radius;
        return per;
    }
    public double area(){
        double s=Math.PI*this.radius*this.radius;
        return s;
    }
    public int relation(Circle c){
        //double dis=this.center.distance(c.center);
        double dis=Math.sqrt(Math.pow(this.center.x+c.center.x,2)+Math.pow(this.center.y+c.center.y,2));
        int tmp=this.radius-c.radius;
        tmp=Math.abs(tmp);
        //判断同一个圆
        if((this.center.x==c.center.x&&this.center.y==c.center.y)&&this.radius==c.radius){
            System.out.println("同一个圆");
            return 0;
        }
        //判断同心圆
        else if(this.center.x==c.center.x&&this.center.y==c.center.y){
            System.out.println("同心圆");
            return 1;
        }
        //判断相交圆
        else if(dis<(this.radius+c.radius)&&dis>tmp){
            System.out.println("相交圆");
            return 2;
        }
        //判断分离圆
        else if(dis>(this.radius+c.radius)){
            System.out.println("分离圆");
            return 3;
        }
        //判断包含圆
        else if(dis<tmp){
            System.out.println("包含圆");
            return 4;
        }
        //判断内切圆
        else if(dis==tmp){
            System.out.println("内切圆");
            return 5;
        }
        //判断外切圆
        else if(dis==(this.radius+c.radius)){
            System.out.println("外切圆");
            return 6;
        }
        return -1;
    }
}
